package game.players.actions;

import game.ball.SoccerBall;
import game.players.SoccerPlayer;
import game.players.states.UserWithoutBall;
import game.soccerField.Arc;

public class Shoot {
	
	private static final int SPEED = 3;
	
	public static void execute(SoccerPlayer player,SoccerBall ball) {
		player.setState(new UserWithoutBall(player));
		Arc arc = player.getRivalArc();
		double i = arc.getX() - player.getX();
		double j = (arc.getY() + arc.getAppearance().getHeight()/2) - player.getY();
		ball.roll(SPEED, i, j);
	}

}
